import java.util.Scanner;

public class Maybe {//https://leetcode.cn/problems/valid-palindrome/description/

    public static boolean huiwenshu(String s2) {
        s2=s2.toLowerCase();
        int i=0;
        int j=s2.length()-1;
        while(i<j&&!isCharacterorNumber(s2.charAt(i)))//只要是非数字字符和字母字符，左指针都往右移动
        {
            i++;
        }
        while(i<j&&!isCharacterorNumber(s2.charAt(j)))
        {
            j--;
        }
        if(s2.charAt(i)==s2.charAt(j))
        {
            i++;
            j--;
        }else{
            return false;
        }
        return true;
    }
    public static boolean isCharacterorNumber(char ch) {
        if((ch>='0'&&ch<='9')||(ch>='a'&&ch<='z')){
            return true;
        }else{
            return false;
        }
    }
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNextLine()){
            String s1=scanner.nextLine();
            boolean r=huiwenshu(s1);
            System.out.println(r);
        }
    }
}
